package com.example.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.entity.User;
import com.example.springboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper //@Mapper注解将mapper标注为spring的一个组件
//使用mapper将数据传入数据库
public interface UserMapper {

//用户列表
    List<User> list();

    List<User> listByCondition(BaseRequest baseRequest);

    void save(User user);

    void register(User user);

    User getById(Integer id);

    void updateById(User user);

    void deleteById(Integer id);

    User getByUserName(String userName);

    User getByUserNameAndPassword(@Param("userName") String userName, @Param("password") String password);
}
